package org.example.entity;

import org.example.dao.FullDataMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class OrderMapper implements FullDataMapper<Order> {
    @Override
    public Order map(ResultSet rs) throws SQLException {
       Order order=new Order();
       int orderId=rs.getInt("ord_id");
       int userId= rs.getInt("user_id");
       double totalAmount=rs.getDouble("total_amount");
       int orderStatus=rs.getInt("ord_status");
       String createTime=rs.getString("create_time");
       String payTime=rs.getString("pay_time");
       order.setOrderId(orderId);
       order.setUserId(userId);
       order.setTotalAmount(totalAmount);
       order.setOrderStatus(orderStatus);
       order.setCreateTime(createTime);
       order.setPayTime(payTime);
       return order;
    }
}